
$(function(){

//	回到顶部
	$("#icon5").click(function(){
		document.documentElement.scrollTop=document.body.scrollTop=0;
		});
//侧边栏
	$("#n_shop").toggle(
			function(){
				$("nav").animate({
					"right":"0",
				},1000);
			$("#myShoopingCart").css({"display":"block"});
			$("#myCoupon").css({"display":"none"});
			$("#myFavorite").css({"display":"none"});
			},
			function(){
				$("nav").animate({
					"right":"-280",
				},1000);
			}
		);
		$("#icon1").toggle(
			function(){
				$("nav").animate({
					"right":"0",
				},1000);
			$("#myShoopingCart").css({"display":"none"});
			$("#myCoupon").css({"display":"block"});
			$("#myFavorite").css({"display":"none"});
			},
			function(){
				$("nav").animate({
					"right":"-280",
				},1000);
			}
		);
		$("#icon2").toggle(
			function(){
				$("nav").animate({
					"right":"0",
				},1000);
			$("#myShoopingCart").css({"display":"none"});
			$("#myCoupon").css({"display":"none"});
			$("#myFavorite").css({"display":"block"});
			},
			function(){
				$("nav").animate({
					"right":"-280",
				},1000);
			}
		);
		//页面跳转
		//点击top回到顶部
		$("#icon5").click(function(){
		document.documentElement.scrollTop=document.body.scrollTop=0;
		});
		$(".top_1").click(function(){
			
			var letGoodsId=this.children[2].children[0].getAttribute("goodsId");
			location.href="decails.html?letgoodsId="+letGoodsId+"";

		});
		$("#myShoopingCart").click(function(){
			location.href="shopping cart.html";
		});
		$("#a_shop").click(function(){
			location.href="shopping cart.html";
		});
		$("#sock").click(function(){
			location.href="productList.html";
		})

})
